//
//  YZSixButton.m
//  kuaiyi
//
//  Created by jacoy on 16/5/5.
//
//

#import "YZSixButton.h"

@implementation YZSixButton

-(void)setHighlighted:(BOOL)highlighted{}

-(void)layoutSubviews{
    [super layoutSubviews];
    CGFloat margin = 15;
    if ([UIScreen mainScreen].bounds.size.height > 568) {
        margin = 35;
        self.titleLabel.font = [UIFont systemFontOfSize:18];
    }
    CGFloat imageWidth = self.imageView.bounds.size.width;
    CGFloat imageHeight = self.imageView.bounds.size.height;
    CGFloat imageX = (self.bounds.size.width - imageWidth)*0.5;
    self.imageView.frame = CGRectMake(imageX, margin, imageWidth, imageHeight);
    
    CGFloat labelWidth = self.titleLabel.bounds.size.width;
    CGFloat labelHeight = self.titleLabel.bounds.size.height;
    CGFloat labelX = (self.bounds.size.width - labelWidth)*0.5;

    self.titleLabel.frame = CGRectMake(labelX, margin+imageHeight+10, labelWidth, labelHeight);
    
}

@end
